// 前端直接开放的路由组件放在这,name作为key，具体资源组件信息查找global.tsx配置的全局资源。（后端权限配置和这个取并集）
const routes: any[] = [
  {
    path: "/",
    name: "HOME_VIEW",
    component: '@/pages/home'
  },
  {
    path: "/home",
    name: "HOME_VIEW",
    component: '@/pages/home'
  },
  {
    path: "/tools",
    name: "TOOL_VIEW",
    routes: [
      {
        path: "tool-list",
        name: "TOOL_LIST_VIEW",
        component: '@/pages/tools/ai_tools'
      },
      {
        path: "twine-tool",
        name: "STORY_DESIGN_VIEW",
        component: '@/pages/tools/twine_tool'
      },
      {
        path: "gpt",
        name: "STORY_DESIGN_VIEW",
        component: '@/pages/tools/gpt'
      },
      {
        path: "ai-doc",
        name: "AI_DOC_VIEW",
        component: '@/pages/tools/ai_doc', 
      },
      {
        path: 'css-tool',
        name: "CSS_TOOL_VIEW",
        component: '@/pages/tools/css_tool',
      },
      {
        path: 'pdf-tool',
        name: "PDF_TOOL_VIEW",
        component: '@/pages/tools/pdf_tool',
      },
    ]
  },
  {
    path: "/post",
    name: "POST_VIEW",
    routes: [
      {
        path: "post-list",
        name: "POST_LIST",
        component: '@/pages/posts/list'
      },
      {
        path: "detail",
        name: "POST_DETAIL",
        component: '@/pages/posts/detail'
      },
    ]
  },
  {
    path: "/other",
    name: "OTHER_VIEW",
    routes: [
      {
        path: "",
        name: "ABOUT_VIEW",
        component: '@/pages/other/about'
      },
      {
        path: "about",
        name: "ABOUT_VIEW",
        component: '@/pages/other/about'
      },
    ]
  },
  { path: '*', component: '@/pages/404' },
]

// app.tsx中进行初始配置
// const appInit = () => {
//   message.config({
//     maxCount: 4,
//   })
// }

const AppConfig: any = {
  routes,
  // appInit
}

export default AppConfig;